﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FileControl.ascx.cs" Inherits="SimplePMT.Control.FileControl" %>
<form name="attachmentForm" id="attachmentForm" method="post" action="FileView.aspx" enctype="multipart/form-data">
<input type="hidden" name="AttachmentID" value="<%= attachment.ID %>" />
<input type="hidden" name="TaskContainerID" value="<%= containerId %>" />

<table width="100%" cellpadding=3>
        <tr>
            <td style="white-space:nowrap;color:#ffffff" bgcolor="#869AAE"><%= attachmentLocation %> : <b><%= viewTitle %></b></td>
        </tr>
        <tr>
            <td style="border:1px solid #6893cf;" bgcolor="#ffffff" valign=top>
                <div id="TaskView">
                <table width="100%" align=center>
                    <tr>
                        <td align=right><b>Title:</b></td>
                        <td><%= FormElement.TextBox(75, "Title", attachmentTitle, "", edit)%></td>
                    </tr>
                    <tr>
                        <td align=right valign=top><b>Description:</b></td>
                        <td><%= FormElement.TextArea(76, 8, "Description", attachment.Description, "", edit)%></td>
                    </tr>
                    <tr>
                        <td align=right><b>Created By:</b></td>
                        <td><%= createdBy %> (on <%= createDate %>)</td>
                    </tr>
                    <% if (attachment.ID > 0) { %>
                    <tr>
                        <td align=right><b>Update Date:</b></td>
                        <td><%= updateDate %></td>
                    </tr>
                    <tr>
                        <td align=right><b>Attachment:</b></td>
                        <td><a href="attachments/<%= attachment.Path %>" target="_new"><%= attachment.Path %></a></td>
                    </tr>
                    <% } %>
                    <tr>
                        <td align=right><b><% if (attachment.ID > 0) { %>Replace<% } else { %>Select<% } %> File:</b></td>
                        <td><input type="file" size=62 name="AttachmentPath" id="AttachmentPath"/></td>
                    </tr>
                    <tr>
                        <td colspan=2 height=5></td>
                    </tr>
                    <tr>
                        <td align=right></td>
                        <td style="white-space:nowrap;" align=right>
                        <% if (attachment.ID > 0) { %>
                        <button type="button" onclick="confirmDelete(<%= attachment.ID %>);">Delete</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <% } %>
                        <button type="button" onclick="cancel();">Cancel</button>&nbsp;
                        <button type="button" onclick="saveFile();">Save Changes</button></span>
                        </td>
                    </tr>
                    
                </table>
                </div>
            </td>
        </tr>
    </table>
    <p>
    <table width="100%" cellpadding=3>
        <tr>
            <td width="90%" style="white-space:nowrap;color:#ffffff" bgcolor="#869AAE" onmouseover="this.style.cursor='pointer';" onclick="showHideAssociations();"><img name="associationsOptionsImage" src="images/closed.gif" />&nbsp;&nbsp;<b>Task Associations</b></td>
        </tr>
        <tr>
            <td style="border:1px solid #6893cf;" valign=top>
                <table width="96%" align=center style="display:none" id="TaskAssociations">
                    <tr>
                        <td><%= taskAssociationList %></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </p>
    </form>